home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.0
/
Video Toaster v4.0.iso
/
arexx
/
cg
/
saveattrib.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-10
|
3KB
|
87 lines
/* SaveAttrib -- Save current char settings to rexx macro */
/* By Bob Caron ©1994 NewTek, Inc. */
filnam = 'ENV:SaveAttrib.state'
version = 'SaveAttrib v1.4'
if (exists(filnam)) then do
if (~open(state, filnam, 'R')) then break
if (readln(state) ~= version) then break
file=readln(state)
end
call close state
if file="FILE" | file="" then
file="Toaster:Arexx/CG/AttribScripts/AttribSet.rexx"
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
call addlib(CG_AREXX,0)
outfile=REQ_FILE("Save Character Attributes As...",filenam,path)
if outfile="" then
exit
file=script
if (open(state, filnam, 'W')) then do
call writeln state, version
call writeln state, outfile
call close state
end
if exists(outfile) then do
x=req_ask("Write Over File '"||outfile||"'?")
if x=0 then do
x=req_tell("Canceled")
end
end
stype=0
if (~open(outfd,outfile,W)) then
call REQ_TELL("Can't open output:",outfile)
bordbotr=translate(GET_BORD(BOTR),","," ")
charrgba=translate(GET_CHAR(RGBA),","," ")
charbotr=translate(GET_CHAR(BOTR),","," ")
shadrgba=translate(GET_SHAD(TOPR),","," ")
bordrgba=translate(GET_BORD(TOPR),","," ")
bordprio=GET_BORD(PRIO)
if get_shad(PRIO)=0 then prio="B"
else prio="T"
if get_shad(type)="None" then stype=0
if get_shad(type)="Cast" then stype=2
if get_shad(type)="Drop" then stype=1
writeln(outfd,"/* "||outfile" -- An Attribute Setter */")
writeln(outfd,"/* By A. Random User ©1994 NewTek, Inc. */")
writeln(outfd,"/* (Based on a program by Bob Caron.) */")
writeln(outfd,"")
writeln(outfd,"call addlib(CG_AREXX,0)")
writeln(outfd,"")
writeln(outfd,"CALL SET_CHAR(FILL,'"||get_char(fill)||"')")
writeln(outfd,"CALL SET_CHAR(BOTR,"||charbotr||")")
writeln(outfd,"CALL SET_CHAR(RGBA,"||charrgba||")")
writeln(outfd,"CALL SET_BORD(FILL,'"||get_bord(fill)||"')")
writeln(outfd,"CALL SET_BORD(BOTR,"||bordbotr||")")
writeln(outfd,"CALL SET_BORD(SIZE,"||left(get_bord(SIZE),1)||")")
writeln(outfd,"CALL SET_BORD(PRIO,"||bordprio||")")
writeln(outfd,"CALL SET_BORD(TOPR,"||bordrgba||")")
writeln(outfd,"CALL SET_SHAD(TYPE,"||stype||")")
writeln(outfd,"CALL SET_SHAD(SPOT,"||get_shad(SPOT)||")")
writeln(outfd,"CALL SET_SHAD(PRIO,"||prio||")")
writeln(outfd,"CALL SET_SHAD(SIZE,"||get_shad(SIZE)||")")
writeln(outfd,"CALL SET_SHAD(TOPR,"||shadrgba||")")
call close(outfd)
call REQ_TELL("Saved...")
call REMLIB(CG_AREXX)
exit